package com.lengyu.vxminiprogram.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lengyu.vxminiprogram.entity.Role;
import com.lengyu.vxminiprogram.mapper.RoleMapper;
import com.lengyu.vxminiprogram.service.IRoleService;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liuyu
 * @since 2023-01-29
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {

    @Override
    public Role getByCode(String roleCode) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("code",roleCode);
        Role role = getOne(queryWrapper);
        return role;
    }
}
